package com.kin207.netty.handle.impl;

import com.kin207.netty.context.RequestContext;
import com.kin207.netty.handle.IMessageHandle;
import com.kin207.netty.msg.vo.GroupAddReqVo;
import com.kin207.netty.session.SessionManagerAbs;

public class GroupAddMessageHandle implements IMessageHandle<GroupAddReqVo> {

	public String name() {
		return "/group/add";
	}

	public Class paramClass() {
		return GroupAddReqVo.class;
	}

	public void handle(GroupAddReqVo param) {
		RequestContext req = RequestContext.curr.get();
		SessionManagerAbs sessionManger = req.getSessionManager();
		sessionManger.addGroup(param.getName(), req.getChannelHandlerContext());
	}

}
